﻿using CardPlay.Model.CardModel;
using CardPlay.Model.GameModel;
using CardPlay.Model.GameModel.Actions;

namespace CardPlay.DemoPack.Games.KlondikeVariants
{
    [Game("2D33FD44-10D4-45BC-B2F8-FEF28FAB1292", LevelOfDifficulty.Easy, LevelOfSkill.ModerateSkill, DurationOfPlay.Within5To10Minutes, Family = FamilyName)]
    public class Whitehead : Klondike
    {
        public Whitehead()
        {
            MaximumDeals = 1;
            TableauBuildSequence = CardFaceSequence.SameColorDescendingRank;
        }

        protected override bool AllowedToPickupAtTableau(RemovePileAction action)
        {
            return action.IsActingOnFaceUpTopPileInSequence(CardFaceSequence.SameSuitDescendingRank);
        }

        protected override bool AllowedToBuildEmptyTableau(MovePileAction action)
        {
            return action.PileBeingMoved.BottomCard.Rank != FoundationBaseRank &&
                (action.IsMovingSingleCard() || action.PileBeingMoved.IsInSequence(TableauBuildSequence));
        }
    }
}